home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmiSoft / Mus / edit / AmySequencer.lha / AmySequencer / MIDIConstants.text < prev    next >
Text File  |  2003-11-16  |  12KB  |  415 lines

  1. ;-> MIDIConstants by Stefano Maria Regattin
  2. ;d> 27 Febbraio 2002 da MIDIDefs.h
  3. ;m> 1,15,16 marzo 2002
  4. ;m> 10,19 aprile 2002
  5. ;m> 4,5 novembre 2002
  6. ;m> 4,6 dicembre 2002
  7. ;m> 15 novembre 2003
  8. ;--------------------
  9.  
  10. ;***************
  11. ;* C. A. M. D. *
  12. ;******************************************************
  13. ;* CMU AMIGA Midi Driver - Carnegie Mellon University *
  14. ;******************************************************
  15. ;* 1988 - Commodore AMIGA *
  16. ;***********************************************
  17. ;* Design & Development  - Roger B. Dannenberg *
  18. ;***********************************************
  19. ;* - Jean-Christophe Dhellemmes *
  20. ;********************************
  21. ;* - Bill Barton *
  22. ;*********************************************
  23. ;* Copyright 1989 Carnegie Mellon University *
  24. ;*********************************************
  25.  
  26. ;****************
  27. ;*              *
  28. ;* Status Bytes *
  29. ;*              *
  30. ;****************
  31.  
  32. ;* channel voice messages (1sssnnnn) (OR with channel number) *
  33. #_NoteOff=-128;             $80
  34. #_NoteOn=-112;              $90
  35. #_PolyphonicKeyPressure=-96;$A0
  36. #_ControlChange=-80;        $B0
  37. #_Mode=-80;                 $B0
  38. #_ProgramChange=-64;        $C0
  39. #_ChannelKeyPressure=-48;   $D0
  40. #_PitchBend=-32;            $E0
  41.  
  42. #_StatusBits=-16;           $F0
  43. #_ChannelBits=15;           $0F, useful values from 0 to 15, that are MIDI
  44. ;                                channels from 1 to 16
  45.  
  46. ;* system common messages (11110sss) *
  47. #_System=-16 ;* min system status byte *
  48. #_SystemExclusive=-16;      $F0
  49. #_QtrFrame=-15;             $F1
  50. #_SongPos=-14;              $F2
  51. #_SongSelect=-13;           $F3
  52. #_TuneReq=-10;              $F6
  53. #_EOX=-9;                   $F7
  54.  
  55. ;* system real time messages (11111sss) *
  56. #_RealTime=$F8 ;* Min real time status byte *
  57. #_Clock=-8;                 $F8
  58. #_Start=-6;                 $F9
  59. #_Continue=-5;              $FA
  60. #_Stop=-4;                  $FB
  61. #_ActiveSense=-2;           $FE
  62. #_Reset=-1;                 $FF
  63.  
  64.  
  65. ;************************
  66. ;*                      *
  67. ;* Standard Controllers *
  68. ;*                      *
  69. ;************************
  70.  
  71. ;* Continuous 14 bit - MSB: 0-1F, LSB: 20-3F *
  72. #_Bank=$00
  73. #_ModulationWheel=$01
  74. #_Breath=$02
  75. #_Foot=$04
  76. #_PortaTime=$05
  77. #_DataEntry=$06
  78. #_Volume=$07
  79. #_Balance=$08
  80. #_Pan=$0A
  81. #_Expression=$0B
  82. #_GeneralOne=$10
  83. #_GeneralTwo=$11
  84. #_GeneralThree=$12
  85. #_GeneralFour=$13
  86.  
  87. ;* Continuous 7 bit (switches: 0-3F=Off, 40-7F=On) *
  88. #_Sustain=$40
  89. #_Portamento=$41
  90. #_Sostenuto=$42
  91. #_SoftPedal=$43
  92. #_HoldTwo=$45
  93. #_GeneralFive=$50
  94. #_GeneralSix=$51
  95. #_GeneralSeven=$52
  96. #_GeneralEight=$53
  97. #_ExtDepth=$5B
  98. #_TremoloDepth=$5C
  99. #_ChorusDepth=$5D
  100. #_CelesteDepth=$5E
  101. #_PhaserDepth=$5F
  102.  
  103. ;* Parameters *
  104. #_DataInc=$60
  105. #_DataDec=$61
  106. #_NRPNL=$62
  107. #_NRPNH=$63
  108. #_RPNL=$64
  109. #_RPNH=$65
  110.  
  111. #_ControllerMaxValue=$78
  112.  
  113. ;*****************
  114. ;*               *
  115. ;* Channel Modes *
  116. ;*               *
  117. ;*****************
  118.  
  119. #_MinModeValue=$79
  120.  
  121. #_ResetCtrl=$79
  122. #_Local=$7A
  123. #_AllNotesOff=$7B
  124. #_OmniOff=$7C
  125. #_OmniOn=$7D
  126. #_Mono=$7E
  127. #_Poly=$7F
  128.  
  129.  
  130. ;********************************
  131. ;*                              *
  132. ;* Registered Parameter Numbers *
  133. ;*                              *
  134. ;***************************************************************************
  135. ;* these are 16 bit values that need To be separated into two bytes for use
  136. ;* with the _RPNH & _RPNL messages using 8 bit math (hi=MRP>>8,lo=MRP_&$FF)
  137. ;* as opposed To 7 bit math. this is done so that the defines match the
  138. ;* numbers from the MMA. see MIDI 1.0 Detailed Spec v4.0 pp 12, 23 For more
  139. ;* info.
  140. ;********
  141.  
  142. #_PBSens=$0000
  143. #_FineTune=$0001
  144. #_CourseTune=$0002
  145.  
  146.  
  147. ;******************************
  148. ;*                            *
  149. ;* MTC Quarter Frame messages *
  150. ;*                            *
  151. ;*****************************************
  152. ;* Qtr Frame message is F1 0nnndddd where
  153. ;*
  154. ;* nnn is a message Type defined below
  155. ;* dddd is 4 bit Data nibble For those message types
  156. ;*
  157. ;* each pair of nibbles is combined by the receiver into a single byte. there
  158. ;* are masks and type values defined for some of these Data bytes below.
  159. ;************************************************************************
  160.  
  161. ;* Message Types *
  162. #_FrameL=$00
  163. #_FrameH=$10
  164. #_SecL=$20
  165. #_SecH=$30
  166. #_MinL=$40
  167. #_MinH=$50
  168. #_HourL=$60
  169. #_HourH=$70 ;* also contains time code type *
  170.  
  171. ;* Message Masks */
  172. #_TypeMask=%01110000 ;* mask for type bits in message *
  173. #_DataMask=%00001111 ;* mask for data bits in message *
  174.  
  175. ;* Hour Byte */
  176. #_HourTypeMask=$60 ;* mask for time code type *
  177. #_HourMask=$1f ;* hours mask (range 0-23) *
  178.  
  179. ;* Time code Type values For hour byte */
  180. #_24FramesPerSecond=$00
  181. #_25FramesPerSecond=$20
  182. #_30FramesPerSecondDrop=$40
  183. #_30FramesPerSecondNoDrop=$60
  184.  
  185. ;*********************
  186. ;*                   *
  187. ;* Sys/Ex ID numbers *
  188. ;*                   *
  189. ;*****************************************************************************
  190. ;* now includes 3 byte extension For the American Group. this new format uses
  191. ;* a $00 as the sys/ex id followed by two additional bytes that actually
  192. ;* identify the manufacturer. these new extended id constants are 32 bit
  193. ;* values with 24 significant bits.
  194. ;***********************************
  195.  
  196. ;* north american group (1 byte) *
  197. #_MID_Sequential=$01
  198. #_MID_IDP=$02
  199. #_MID_OctavePlateau=$03
  200. #_MID_Moog=$04
  201. #_MID_Passport=$05
  202. #_MID_Lexicon=$06
  203. #_MID_Kurzweil=$07
  204. #_MID_Fender=$08
  205. #_MID_Gulbransen=$09
  206. #_MID_AKG=$0A
  207. #_MID_Voyce=$0B
  208. #_MID_Waveframe=$0C
  209. #_MID_ADA=$0D
  210. #_MID_Garfield=$0E
  211. #_MID_Ensoniq=$0F
  212. #_MID_Oberheim=$10
  213. #_MID_Apple=$11
  214. #_MID_GreyMatte=$12
  215. #_MID_PalmTree=$14
  216. #_MID_JLCooper=$15
  217. #_MID_Lowrey=$16
  218. #_MID_AdamsSmith=$17
  219. #_MID_Emu=$18
  220. #_MID_Harmony=$19
  221. #_MID_ART=$1A
  222. #_MID_Baldwin=$1B
  223. #_MID_Eventide=$1C
  224. #_MID_Inventronics=$1D
  225. #_MID_Clarity=$1F
  226.  
  227. ;* north american group (3 bytes) *
  228. #_MID_XAmerica=$00 ;* north american 3 bytes prefix *
  229.  
  230. #_MIDX_DigitalMusic=$000007
  231. #_MIDX_Iota=$000008
  232. #_MIDX_Artisyn=$00000A
  233. #_MIDX_IVL=$00000B
  234. #_MIDX_SouthernMusic=$00000C
  235. #_MIDX_LakeButler=$00000D
  236. #_MIDX_DOD=$000010
  237. #_MIDX_PerfectFret=$000014
  238. #_MIDX_KAT=$000015
  239. #_MIDX_Opcode=$000016
  240. #_MIDX_Rane=$000017
  241. #_MIDX_SpatialSound=$000018
  242. #_MIDX_KMX=$000019
  243. #_MIDX_Brenell=$00001A
  244. #_MIDX_Peavey=$00001B
  245. #_MIDX_360=$00001C
  246. #_MIDX_Axxes=$000020
  247. #_MIDX_CAE=$000026
  248. #_MIDX_Cannon=$00002B
  249. #_MIDX_BlueSkyLogic=$00002E
  250. #_MIDX_Voce=$000031
  251.  
  252. ;* european group */
  253. #_MID_SIEL=$21
  254. #_MID_Synthaxe=$22
  255. #_MID_Hohner=$24
  256. #_MID_Twister=$25
  257. #_MID_Solton=$26
  258. #_MID_Jellinghaus=$27
  259. #_MID_Southworth=$28
  260. #_MID_PPG=$29
  261. #_MID_JEN=$2A
  262. #_MID_SSL=$2B
  263. #_MID_AudioVeritrieb=$2C
  264. #_MID_Elka=$2F
  265. #_MID_Dynacord=$30
  266. #_MID_Clavia=$33
  267. #_MID_Soundcraft=$39
  268.  
  269. ;* japanese group */
  270. #_MID_Kawai=$40
  271. #_MID_Roland=$41
  272. #_MID_Korg=$42
  273. #_MID_Yamaha=$43
  274. #_MID_Casio=$44
  275. #_MID_Kamiya=$46
  276. #_MID_Akai=$47
  277. #_MID_JapanVictor=$48
  278. #_MID_Mesosha=$49
  279.  
  280. ;* universal ID Numbers *
  281. #_MID_UNC=$7D
  282. #_MID_UNRT=$7E
  283. #_MID_URT=$7F
  284.  
  285. ;*****************
  286. ;*               *
  287. ;* Miscellaneous *
  288. ;*               *
  289. ;*****************
  290.  
  291. #_MiddleC=60 ;* Middle C note value *
  292. #_DefaultVelocity=64 ;* default note ON or OFF velocity *
  293. #_PitchBendCenter=$2000 ;* pitch bend center position as a 14 bit word *
  294. #_MClksPerQtr=24  ;* MIDI clocks per quarter note *
  295. #_MClksPerSP=6 ;* MIDI clocks per song position index *
  296. #_PanAndSimilarCenter=64 ;* center value for controllers like pan and balance *
  297.  
  298. ;***************************************
  299. ;*                                     *
  300. ;* Standard MIDI File Format Constants *
  301. ;*                                     *
  302. ;***************************************
  303.  
  304. ;* Header Chunk *
  305.  
  306. HeaderMarker$="MThd" ;four chars, that are four bytes
  307. #_MarkerLength=6      ;word, that are two bytes
  308.  
  309. #_FormatZero=0        ;word
  310. #_FormatOne=1         ;word
  311. #_FormatTwo=2         ;word
  312. ;You must select only one of these!
  313.  
  314. ;These constants represent the standard MIDI file header structure; must be
  315. ; followed by the number of tracks as a word and after this by the ticks per
  316. ; quarter notes as a word; if this last is a negative number it is the SMPTE
  317. ; time encoding stated as follows:
  318. ;bit 8-14 -> video frames per second; useful values 25, 28, 29 or 30.
  319. ;bit 0-7  -> ticks per video frames; useful values 4, 8, 10 or 80.
  320.  
  321. ;* Track Chunk *
  322.  
  323. TrackMarker$="MTrk" ;four chars, that are four bytes.
  324. ;The track header must be followed by the length of the track as a four bytes
  325. ; number; after this must come the delta time of the event to come and then
  326. ; the event; the delta time is structured as one or more bytes as required,
  327. ; where each 0-6 bits of the byte represent the length by ticks and must be
  328. ; added to the previous one and if there is another byte to come the bit 7
  329. ; will retain 1, otherwise it will retain 0.
  330.  
  331. ;After the delta time byte or bytes, must come the event, that must be a MIDI
  332. ; event, a SYStem EXclusive event or another kind of event that is useful to
  333. ; the sequencer.
  334. ;The SYSEX event has the following syntax:
  335. ; F0     ;a byte
  336. ; Length ;as delta time
  337.  
  338. ;There is another way to represent SYSEX events, that is as follows:
  339. ; F7     ;a byte
  340. ; Length ;as delta time
  341. ; Event  ;an unknown byte
  342.  
  343. #_MetaEvent=-1 ;$FF ,a byte
  344. ;The last kind of events that aren't MIDI or SYSEX events are as follows:
  345. ; FF     ;a byte for the meta event identifier
  346. ; Type   ;a byte
  347. ; Length ;as delta time
  348. ; Datum  ;a byte
  349. ;If there isn't the datum, the length is of one byte and is zero, where also
  350. ; the bit 7 is zero, stating the end of the delta time.
  351. ;The type of these events are the following:
  352.  
  353. #_SequenceNumber=0
  354. ;A byte that must be followed by a byte retaining a value of 2 that states the
  355. ; Lenght of the incoming word that retains the sequence number (for the
  356. ; Standard MIDI File Format Two, or the track number for the others Zero and
  357. ; One Standard MIDI File Format); for the Standard MIDI File Format Zero the
  358. ; track is unique.
  359. ;At end comes the Sequence (or track) numbers, that is represented by a word.
  360.  
  361. #_Text=1
  362. ;This allows to insert a text into the MIDI file.
  363.  
  364. #_Copyright=2
  365. ;This allows to insert the copyright into the MIDI file.
  366.  
  367. #_SequenceName=3
  368. ;This allows to insert the name of the sequence, for the Format Two, for track
  369. ; for the Format Zero and One.
  370.  
  371. #_InstrumentName=4
  372. ;This allows to insert the name of the instruments.
  373.  
  374. #_Lyric=5
  375. ;This allows to insert the words of the song.
  376.  
  377. #_NameMarker=6
  378. ;This allows to insert a name to a point of the song.
  379.  
  380. #_CuePoint=7
  381. ;This allows to insert a reminder to a point of the song.
  382.  
  383. #_MIDIChannelPrefix=$20
  384. ;This states that all the following events have the same MIDI channel until
  385. ; otherwise specified.
  386.  
  387. #_EndOfTrackChunk=$2F
  388. ;This states the end of the track chunk.
  389.  
  390. #_TempoChange=$51
  391. ;This allows to insert a microseconds per quarter note tempo variation.
  392.  
  393. #_SMPTEStartOffset=$54
  394. ;This states the start time of the track chunk represented in the SMPTE
  395. ; format.
  396.  
  397. #_TimeSignatureChange=$58
  398. ;This allows to change the time signature, where the first byte is the
  399. ; numerator and the following byte is the denominator as power of two number;
  400. ; follows the MIDI ticks for a beat and the last byte retains the number of
  401. ; thirtysecond notes for a quarter, there are usually 24 ticks.
  402.  
  403. #_KeySignatureChange=$59
  404. ;This allows to change the kind of scale by its Diesis (#) or Bemoll (b),
  405. ; where the first byte retains the number of the alterations (# or b), as
  406. ; follows:
  407. ;equal to Zero=no alteration (Do/C scale)
  408. ;greater than Zero (value from 1 to 7)=number of Diesis (#)
  409. ;less than Zero (value from -1 to -7)=number of Bemolls (b)
  410. ; The following byte states if the scale is major (value 0) or minor (value
  411. ; 1).
  412.  
  413. #_OutOfStandard=$7F
  414. ;This allows to insert data related to a specific kind of musical instruments.
  415.